import instance from "@/utils/request";

// 获取验证码的请求
export const getCaptcha = () => instance.get('/captcha')

//登录请求
export const login = (user) => instance.post('/users/login', user)

// 获取用户列表
export const userList = (queryCondition) => instance.post('/users/list', queryCondition)

// 批量删除
export const batchDelete = (uids) => instance.delete('/users', {data: uids})

//修改用户状态
export const editUserState = (user) => instance.put('/users/state', user)

//重置密码
export const resetPassword = (uid) => instance.put('/users/resetPwd/' + uid)

// 添加用户信息
export const addUser = (userForm) => instance.post('/users', userForm)

//根据id  获取用户信息
export const getUserById = (uid) => instance.get('/users/'+uid)

//修改用户信息
export const editUser = (userForm) => instance.put('/users/editUser/' ,userForm)

//获取用户个人信息
export const getPersonalInfo = () => instance.get('/users/personalInfo')

//编辑个人信息
export const editPersonalInfo = (userForm) => instance.put('/users/editPersonalInfo/' ,userForm)


//编辑个人密码
export const editPersonalPassword = (passwordForm) => instance.put('/users/editPersonalPassword/' ,passwordForm)

// 安全退出
export  const  logout = ()=>instance.get("/users/logout")


// 获取用户的权限
export  const  getUserPermissions = ()=>instance.get("/users/permissions")


